package com.jbm.onehome.iface;

import com.jbm.core.iface.IAcross;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;

/**
 * Created by Administrator on 2017/6/10.
 */
@Entity
@Table(name = "delivery_code", schema = "", catalog = "")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
public class DeliveryCodeEntity extends IAcross
{
    public DeliveryCodeEntity()
    {
        super();
    }

    public DeliveryCodeEntity(IAcross ia)
    {
        super(ia);
    }
    private int dcId;
    private String code;
    private String memo;
    private Integer fromId;
    private Integer toId;
    private Timestamp createDate;
    private Timestamp closeDate;
    private List<DeliveryCodeEntity> list;

    private LoginEntity toLoginEntity;

    @Id
    @Column(name = "dc_id")
    @GeneratedValue
    public int getDcId() {
        return dcId;
    }

    public void setDcId(int dcId) {
        this.dcId = dcId;
    }

    @Basic
    @Column(name = "code")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "memo")
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Basic
    @Column(name = "from_id")
    public Integer getFromId() {
        return fromId;
    }

    public void setFromId(Integer fromId) {
        this.fromId = fromId;
    }

    @Basic
    @Column(name = "to_id")
    public Integer getToId() {
        return toId;
    }

    public void setToId(Integer toId) {
        this.toId = toId;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "close_date")
    public Timestamp getCloseDate() {
        return closeDate;
    }

    public void setCloseDate(Timestamp closeDate) {
        this.closeDate = closeDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DeliveryCodeEntity that = (DeliveryCodeEntity) o;

        if (dcId != that.dcId) return false;
        if (closeDate != null ? !closeDate.equals(that.closeDate) : that.closeDate != null) return false;
        if (code != null ? !code.equals(that.code) : that.code != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (fromId != null ? !fromId.equals(that.fromId) : that.fromId != null) return false;
        if (memo != null ? !memo.equals(that.memo) : that.memo != null) return false;
        if (toId != null ? !toId.equals(that.toId) : that.toId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = dcId;
        result = 31 * result + (code != null ? code.hashCode() : 0);
        result = 31 * result + (memo != null ? memo.hashCode() : 0);
        result = 31 * result + (fromId != null ? fromId.hashCode() : 0);
        result = 31 * result + (toId != null ? toId.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + (closeDate != null ? closeDate.hashCode() : 0);
        return result;
    }
@Transient
    public List<DeliveryCodeEntity> getList() {
        return list;
    }

    public void setList(List<DeliveryCodeEntity> list) {
        this.list = list;
    }

    @Transient
    public int start;
    @Transient
    public int pagesize;

    @Transient
    public LoginEntity getToLoginEntity() {
        return toLoginEntity;
    }

    public void setToLoginEntity(LoginEntity toLoginEntity) {
        this.toLoginEntity = toLoginEntity;
    }
}
